package 报数游戏19698;

import java.time.chrono.MinguoChronology;

public class Main {
	public static void main(String[] args) {
		long num=202420242024L;
		long l=0;
		long r=Long.MAX_VALUE;
		long tmp=0;
		while(l<=r) {
			long mid=l+(r-l)/2;
			long sum=mid/20+mid/24-mid/120;
			if(sum>=num) {
				tmp=mid;
				r=mid-1;
			}else {
				l=mid+1;
			}
		}
		System.out.println(tmp);
	}
}
